var	neiDiv = document.querySelector('.nei');
var niuDiv = document.querySelectorAll('.niu');

// var bianDiv = document.querySelector('.bian');
function huaD(a){
	neiDiv.style.transform = "translateX(-" + 1000 * a + "px)";
	for (var i = 0; i < niuDiv.length; i++) {
		niuDiv[i].className = 'niu';
	}
	console.log(a);
	niuDiv[a].className = 'niu bian';

	// bianDiv.style.display = inlineBlock;

	zd = a;
}





var zd = 0;
var bu = 1;

function autoPlay(){
	if (zd >= niuDiv.length - 1) {
		zd = -1;}
	// } else if(zd<= 0 ){
	// 	bu = 1;
	// }

	zd = zd + bu;

	huaD(zd);
}
var	sj = setInterval(function(){
	autoPlay();
},4000);


var xskDiv = document.querySelector('.xsk');

xskDiv.onmouseenter = function(){
	clearInterval(sj);
};

xskDiv.onmouseleave = function(){
	sj = setInterval(function(){
		autoPlay();
	},4000);
};














